<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <style type="text/css">

    </style>
</head>

<body class="wrap">
</body>
<script type="text/javascript" src="./script/api.js"></script>
<!-- <script type="text/javascript" src="./script/easeChat.js"></script> -->
<script type="text/javascript">
    apiready = function() {
      // fnAccountListener();
        api.setStatusBarStyle({
            style: 'light'
        });
        // 获取登录时候储存的用户参数
        api.getPrefs({
            key: 'user'
        }, function(ret, err) {
            if (ret && ret.value !== "") {
                // 判断用户参数不为空登录首页main
                openMain();
            } else {
                //否则跳到登录页面进行登录
                openLogin();
            }
        });
    };
    // 打开登录页
    function openLogin() {
        api.openWin({
            name: 'login',
            url: './html/login/login.html',
            slidBackEnabled: false
        })
    }
    // 打开首页
    function openMain() {
        api.openWin({
            name: 'main',
            url: './html/main.html',
            slidBackEnabled: false
        })
    }
</script>

</html>
